import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule, Routes, Router } from '@angular/router';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { HeroesModule } from './heros/heroes.module';

import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { ComposeMessageComponent } from './compose-message.component';

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CrisisCenterRoutingModule } from "./crisis-center/crisis-center-routing.module";
import { CrisisCenterModule } from './crisis-center/crisis-center.module';
import { AdminModule } from './admin/admin.module';
import { LoginComponent } from './login.component';

import { LoginRoutingModule } from './login-routing.module';
import { DialogService } from './dialog.service';

import { CanDeactivateGuard } from "./can-deactivate-guard.service";
import { AdminRoutingModule } from "./admin/admin-routing.module";

@NgModule({
  declarations: [
    AppComponent,
    PageNotFoundComponent,
    ComposeMessageComponent,
    LoginComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    BrowserAnimationsModule,
    HeroesModule,
    CrisisCenterModule,
    CrisisCenterRoutingModule,
    AdminModule,
    AdminRoutingModule,
    LoginRoutingModule,
    AppRoutingModule
  ],
  providers: [DialogService, CanDeactivateGuard],
  bootstrap: [AppComponent]
})
export class AppModule {
  constructor(router: Router) {
    console.log('Routes: ', JSON.stringify(router.config, undefined, 2));
  }
}
